<template>
  <div class="home">
    <!-- model -->
    <router-view />
    <Menu></Menu>
    <div class="s-user">
      <img
        class="s-user-up"
        :src="require('@/assets/back.png')"
        @click="backFlage = true"
      />
      <img
        class="s-user-user"
        src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
        alt=""
      />
      <img
        @click="infoFlage = true"
        class="s-user-info"
        :src="require('@/assets/email.png')"
      />
    </div>
    <div class="s-model" v-if="backFlage">
      <img
        style="
          position: absolute;
          width: 24px;
          height: 24px;
          z-index: 1;
          right: 8px;
          top: 2px;
        "
        :src="require('@/assets/close.png')"
        alt=""
        @click="backFlage = false"
      />
      <div class="box1">
        <div class="box1-left">
          <el-upload
            class="avatar-uploader"
            action="https://jsonplaceholder.typicode.com/posts/"
            :show-file-list="false"
          >
            <img v-if="imageUrl" :src="imageUrl" class="avatar" />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
        </div>
        <div class="box1-right">
          <div><el-input value="字段1" /></div>
          <div><el-input value="字段1" /></div>
          <div><el-input value="字段1" /></div>

          <!-- <el-input value="字段1" />
                    <el-input value="字段1" /> -->
        </div>
      </div>
      <div class="box2">
        <el-input
          type="textarea"
          :autosize="{ minRows: 2, maxRows: 4 }"
          placeholder="请输入内容"
          v-model="textarea2"
        >
        </el-input>
      </div>
      <div class="box2">
        <el-input
          type="textarea"
          :autosize="{ minRows: 2, maxRows: 4 }"
          placeholder="请输入内容"
          v-model="textarea2"
        >
        </el-input>
      </div>
      <div class="box3">
        <el-button>Default</el-button><el-button>Default</el-button
        ><el-button>Default</el-button><el-button>Default</el-button>
      </div>
      <div class="box4">
        <el-input
          type="textarea"
          :autosize="{ minRows: 6, maxRows: 8 }"
          placeholder="请输入内容"
          v-model="textarea2"
        >
        </el-input>
      </div>
      <div class="box5">
        <div class="box5-left">
          <el-upload
            class="upload-demo"
            drag
            action="https://jsonplaceholder.typicode.com/posts/"
            multiple
          >
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">
              将文件拖到此处，或<em>点击上传</em>
            </div>
          </el-upload>
        </div>
        <div class="box5-right">
          <el-button>Default</el-button><el-button>Default</el-button>
        </div>
      </div>
    </div>
    <div class="s-model" v-if="infoFlage">
      <img
        style="
          position: absolute;
          width: 24px;
          height: 24px;
          z-index: 1;
          right: 8px;
          top: 2px;
        "
        :src="require('@/assets/close.png')"
        alt=""
        @click="infoFlage = false"
      />
      <div class="s-bar-title">
        <span
          class="s-bar-title-left"
          @click="isActive = 0"
          :class="isActive == 0 ? 'active' : ''"
          >系统</span
        ><span
          class="s-bar-title-right"
          @click="isActive = 1"
          :class="isActive == 1 ? 'active' : ''"
          >消息</span
        >
      </div>
      <template v-if="isActive == 0">
        <div>
          <div class="s-info-box">
            <div class="s-notify-img">
              <img
                style="width: 40px; height: 40px"
                src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
                alt=""
              />
            </div>
            <div class="s-notify-right">
              <div class="s-notify-right-time">
                <span>系统</span>
                <span>testß</span>
              </div>
              <div class="s-notify-right-content">
                一段内容一段内容一段内容一段内容一段内容
              </div>
            </div>
          </div>
          <div class="s-info-box">
            <div class="s-notify-img">
              <img
                style="width: 40px; height: 40px"
                src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
                alt=""
              />
            </div>
            <div class="s-notify-right">
              <div class="s-notify-right-time">
                <span>系统</span>
                <span>testß</span>
              </div>
              <div class="s-notify-right-content">
                一段内容一段内容一段内容一段内容一段内容
              </div>
            </div>
          </div>
        </div>
      </template>
      <template v-else>
        <div>
          <div class="s-info-box">
            <div class="s-notify-img">
              <img
                style="width: 80px; height: 80px"
                src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
                alt=""
              />
            </div>
            <div class="s-notify-right">
              <div class="s-notify-right-time">
                <span>test</span>
                <span>testß</span>
              </div>
              <div class="s-notify-right-content">
                一段内容一段内容一段内容一段内容一段内容
              </div>
            </div>
          </div>
          <div class="s-info-box">
            <div class="s-notify-img">
              <img
                style="width: 80px; height: 80px"
                src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
                alt=""
              />
            </div>
            <div class="s-notify-right">
              <div class="s-notify-right-time">
                <span>test</span>
                <span>testß</span>
              </div>
              <div class="s-notify-right-content">
                一段内容一段内容一段内容一段内容一段内容
              </div>
            </div>
          </div>
        </div>
      </template>
    </div>
    <div class="video-box">
      <div class="video-img">
        <img :src="require('@/assets/cover4.jpg')" alt="" />
        <img class="song-play" :src="require('@/assets/play.png')" alt="" />
      </div>
      <div class="video-info">
        <div>歌曲名字</div>
        <div class="song-info">
          <div>name</div>
          <div>时间</div>
        </div>
      </div>
      <div class="video-song">
        <img :src="require('@/assets/音乐.png')" alt="" />
      </div>
    </div>
    <div v-show="notifyVis" class="s-notify" @click="notifyVis = false">
      <div class="s-notify-left">
        <img
          style="width: 20px; height: 20px; background: unset"
          :src="require('@/assets/close.png')"
          alt=""
        />
      </div>
      <div class="s-notify-img">
        <img
          style="width: 80px; height: 80px"
          src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
          alt=""
        />
      </div>
      <div class="s-notify-right">
        <div class="s-notify-right-time">test test</div>
        <div class="s-notify-right-content">
          一段内容一段内容一段内容一段内容一段内容
        </div>
      </div>
    </div>

    <!-- model-end -->
  </div>
</template>

<script>
// @ is an alias to /src
import TopUser from "@/components/TopUser.vue";
import LeftList from "../components/LeftList.vue";
import Menu from "../components/Menu.vue";

export default {
  name: "Home",
  components: {
    TopUser,
    LeftList,
    Menu,
  },
  data() {
    return {
      isActive: 0,
      backFlage: true,
      infoFlage: true,
      notifyVis: true,
    };
  },
};
</script>

<style scoped>
.home {
  background-color: #313735;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.card {
  /* color: #000000; */
}
.card-title {
  display: flex;
  padding: 2px;
  border-bottom: 1px solid lightblue;
}
.card-title-main {
  font-size: 16px;
  font-weight: bold;
  margin-right: 12px;
}
.card-title-sub {
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.card-title-sub span {
  padding: 0 4px;
}

.video-box {
  /* width: 240px; */
  /* height: 80px; */
  display: flex;
  position: fixed;
  bottom: 120px;
  left: 0;
  justify-content: space-between;
  background-color: #2f2f31;
}
.video-img {
  height: 80px;
  width: 80px;
  background-color: #2f2f31;
  display: flex;
  align-items: center;
}
.video-img img {
  height: 60px;
  width: 60px;
  border-radius: 50%;
}

.video-info {
  display: none;
  background-color: #2f2f31;
  font-size: 12px;
  /* display: flex; */
  width: 120px;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 0;
  padding-right: 8px;
}
.video-box:hover .video-info {
  display: flex;
}

.song-info {
  display: flex;
  justify-content: space-between;
}
.video-song {
  width: 18px;
  line-height: 80px;
  background-color: #1d6275;
}

.video-img .song-play {
  position: absolute;
  height: 24px;
  width: 24px;
  left: 20px;
}

.s-model {
  height: 700px;
  width: 500px;
  border-radius: 20px;
  background-color: #252525;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  z-index: 10;
}
.box1 {
  display: flex;
  flex-direction: row;
}
.box1-left {
  width: 120px;
  height: 120px;
}
.box1-right {
  margin-left: 20px;
  flex: 1;
}
.box2 {
  margin: 12px 0;
}
.box3 {
  display: flex;
  justify-content: space-between;
}
.box4 {
  margin: 12px 0;
}
.box5 {
  margin: 12px 0;
  display: flex;
  justify-content: space-between;
}
.box5-left {
  width: 70%;
}
.box5-right {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: flex-end;
}

.s-notify {
  width: 400px;
  height: 100px;
  position: absolute;
  right: 0;
  top: 120px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #252525;
  z-index: 10;
}
.s-notify-left {
  width: 20px;
  height: 100px;
  background-color: rgb(102, 53, 53);
  display: flex;
  align-items: center;
}
.s-notify-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-left: 4px;
  border: 1px solid gray;
  overflow: hidden;
}
.s-notify-right {
  flex: 1;
  padding-left: 12px;
  display: inherit;
  flex-direction: column;
  justify-content: space-between;
}
.s-notify-right-time {
  display: inherit;
  justify-content: space-between;
}

.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 120px;
  height: 120px;
  line-height: 120px;
  text-align: center;
}
.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
.el-textarea__inner {
  background-color: #252525;
}
.el-upload-dragger {
  background-color: #252525;
}
.el-input__inner {
  background-color: #252525;
}
.el-button {
  background-color: #252525;
}
.el-upload.el-upload--text {
  height: 120px;
  width: 120px;
}
input[type="file"] {
  visibility: hidden;
}
.el-button.el-button--default span {
  background-color: unset;
}

.s-user {
  position: absolute;
  z-index: 10;
  top: 20;
  right: 100px;
  display: flex;
  align-items: center;
  top: 14px;
  width: 100px;
  justify-content: space-between;
  background: unset;
  cursor: pointer;
}
.s-user-up {
  cursor: pointer;
}
.s-user-user {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
}
.s-user-info {
  cursor: pointer;
}
.s-info-box {
  display: flex;
  border-bottom: 1px solid #441bd8;
  padding: 12px 0;
}
.s-bar-title {
  text-align: center;
}
.s-bar-title-left {
  /* padding: 4px 6px; */
  background: #363434;
  border-bottom-left-radius: 40px;
  border-top-left-radius: 40px;
  /* height: 36px; */
  display: inline-block;
  width: 67px;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
}
.s-bar-title-right {
  /* padding: 4px 6px; */
  background: #363434;
  border-bottom-right-radius: 40px;
  border-top-right-radius: 40px;
  /* height: 36px; */
  display: inline-block;
  width: 67px;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
}
.active {
  background: gray;
}
</style>
